home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-in_the_mag-
/
pdselect
/
ispell_yam
/
rexx
/
ispell_lang.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
2000-03-08
|
2KB
|
62 lines
/*-------------------------------------------------------------------------------------------------
iSpell_lang.rexx 0.4
Brecht Machiels <darklite@flashmail.com>
---------------------------------------------------------------------------------------------------
$VER: iSpell_lang v0.4
$AUTHOR: Copyright © 1999 Brecht Machiels
$DESCRIPTION: Language selector for iSpell scripts
-------------------------------------------------------------------------------------------------*/
OPTIONS RESULTS
a = OPEN('envvar', 'ENV:ISPELLYAM', 'R')
IF a = 0 THEN oldlang = 'none'
ELSE DO
oldlang = READLN('envvar')
CLOSE('envvar')
END
i = 0
ADDRESS 'COMMAND' 'C:List iSpell:lib/#?.hash LFormat %m >T:ilanguages'
a = OPEN('langlist', 'T:ilanguages', 'R')
IF a = 0 THEN EXIT 10
ELSE DO i = i + 1 WHILE EOF('langlist') = 0
tlang = READLN('langlist')
cap = TRANSLATE(SUBSTR(tlang, '1', '1'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')
LANGUAGE.i = OVERLAY(cap, tlang)
END
LANGUAGE.0 = i - 2
IF LANGUAGE.0 > 1 THEN DO
languages = LANGUAGE.1
DO langnr = 2 TO LANGUAGE.0
languages = languages||"|"||LANGUAGE.langnr
END
languages = "_Save|"||languages||"|_Cancel"
ADDRESS 'YAM' 'REQUEST "cCurrent language: 'oldlang'\n\ncSelect the new language:" "'languages'"'
SELECT
WHEN result = 0 THEN EXIT
WHEN result = 1 THEN ADDRESS 'COMMAND' 'copy ENV:ISPELLYAM ENVARC:'
OTHERWISE DO
sel = result - 1
ADDRESS 'COMMAND' 'setenv ISPELLYAM 'LANGUAGE.sel
END
END
END
ELSE DO
ADDRESS 'COMMAND' 'setenv ISPELLYAM 'LANGUAGE.1
ADDRESS 'YAM' 'REQUEST "cCurrent language: 'LANGUAGE.1'\n\ncYou have only one language installed" "_Save|_Cancel"'
SELECT
WHEN result = 0 THEN EXIT
WHEN result = 1 THEN ADDRESS 'COMMAND' 'copy ENV:ISPELLYAM ENVARC:'
END
END
EXIT